package com.itheima.dao;

public class MyTemplate {
    private static JdbcTemplate jdbcTemplate=null;
    public static JdbcTemplate getJdbcTemplate(){
        if (jdbcTemplate!=null){
            return jdbcTemplate;
        }

        DruidDataSource druidDataSource = new DuidDataSource();
        druidDataSource.setDriverClassName("com.mysql.jdbc.Driver");
        druidDataSource.setUserName("root");
        druidDataSource.setPassword("root");
        druidDataSource.setUrl("jdbc:mysql://localhost:3306/test");
        jdbcTemplate = new JdbcTemolate();
        jdbcTemplate.setDataSoure(druidDataSource);
        return jdbcTemplate;
    }

}
